package com.example.demo.config;


import com.example.demo.model.UserInfo;
import lombok.Data;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Component;


@Component
public class BeanConfig {

    @Primary
    @Bean(name={"user1","czq"})
    public UserInfo user1(){
        UserInfo user=new UserInfo(1,19,"czq");
        return user;
    }

    @Bean(name={"user2","ccs"})
    public UserInfo user2(){
        UserInfo user=new UserInfo(2,29,"ccs");
        return user;
    }


}
